algorithm explanation

visit shbcf.ru